package com.geekca.d5;

public class FindIndex {
    public static void main(String[] args) {
        int[] arr = {11, 22, 33, 44, 55};
        System.out.println(findIndex(23, arr));
        System.out.println(findIndex(33, arr));

    }

    public static int findIndex(int toFind, int[] arr) {
        for (int i = 0; i < arr.length; i++) {
            if (toFind == arr[i]) {
                return i;
            }
        }
        return -1;
    }
}
